/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.openbookformat.obffinder;

import java.util.List;
import java.util.Observable;
import java.util.Observer;
import org.openide.nodes.Children;
import org.openide.nodes.Node;

/**
 *
 * @author MUFEED
 */
public class FindUtilNode extends Children.Keys {
    List findResults;

    public FindUtilNode(List findResults) {
        this.findResults = findResults;
        //System.out.println("Setting the keys");
        setKeys(findResults);
    }

    @Override
    protected void addNotify() {
        setKeys(findResults);
    }


    @Override
    protected Node[] createNodes(Object key) {
        //System.out.println("Key[FU]:" + key.getClass());
        //System.out.println("Create Nodes:" + ((Chapter) key).getTitle());
        FindResultNode node = new FindResultNode((FindResult) key);
        return new Node[]{ node };
    }

}
